let mysql=require('mysql');

let db=mysql.createConnection({
    host:'localhost',
    user:'root',
    password:'root',
    database:'tiantianpeiwan',
    timezone:'08:00'
});


let xmloginModule={
    login:function (user,pass,fn) {
        let sql=`select * from p_admin where A_user="${user}"`;

        db.query(sql,function (err,data) {
            fn(err,data)
        })
    },
    // 权限限制
    xmgetindex:function (user,fn) {
        let sql=`select A_jur as Iimit from p_admin where A_user="${user}"`;
        db.query(sql,function (err,data) {
            fn(err,data)
        })
    }
};

module.exports=xmloginModule;